// const url = require("url");

// const str = "http://www.liyang.com:3000/abc/qwe/index.html?username=admin&password=123#top";

// const obj = url.parse(str, true)
// console.log(obj)


// const urlObj = {
//   protocol: 'http:',
//   slashes: true,
//   auth: null,
//   host: 'www.liyang.com:3000',
//   port: '3000',
//   hostname: 'www.liyang.com',
//   hash: '#top',
//   search: '?username=admin&password=123',
//   query: { username: 'admin', password: '123' },
//   pathname: '/abc/qwe/index.html',
//   path: '/abc/qwe/index.html?username=admin&password=123',
//   href: 'http://www.liyang.com:3000/abc/qwe/index.html?username=admin&password=123#top'
// }

// const urlStr = url.format(urlObj);
// console.log(urlStr);


// =========


// const str = "http://www.liyang.com:3000/abc/qwe/index.html?username=admin&password=123#top";

// const obj = new URL(str);

// console.log(obj)

